package com.yike.order.param;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yike.common.api.Update;
import com.yike.common.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 订单详情表
 *
 * @author yike
 * @since 2024-07-17
 */
@Data
@Accessors(chain = true)
public class AddOrderDetailParam implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "商品ID", required = true)
    @NotNull(message = "商品ID不能为空")
    private Long goodsId;

    @ApiModelProperty(value = "销售单价", required = true)
    @NotNull(message = "商品ID不能为空")
    @Min(value = 0, message = "商品售价不能小于0")
    private BigDecimal price;

    @ApiModelProperty(value = "购买数量", required = true)
    @NotNull(message = "商品ID不能为空")
    @Min(value = 1, message = "购买数量不能小于1")
    private Integer number;

    @ApiModelProperty(value = "商品名称", required = true)
    private String goodsName;

}
